import { createRouter, createWebHashHistory } from "vue-router";
import Register from "../views/login/Register.vue";

const routes = [
  {
    path: "/",
    name: "Register",
    component: Register,
  },

  {
    path: "/home",
    name: "Home",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Home" */ "../views/home/Home.vue"),
    meta: {
      keepAlive: true, // 需要被缓存
    },
  },
  {
    path: "/info",
    name: "Info",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Info" */ "../views/info/Info.vue"),
  },
  {
    path: "/notes",
    name: "Notes",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Notes" */ "../views/notes/Notes.vue"),
  },
  {
    path: "/scenic",
    name: "Scenic",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Scenic" */ "../views/home/Scenic.vue"),
  },
  {
    path: "/cityList",
    name: "CityList",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "CityList" */ "../views/home/CityList.vue"),
  },
  {
    path: "/addressDetails",
    name: "AddressDetails",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "AddressDetails" */ "../views/home/AddressDetails.vue"
      ),
  },
  {
    path: "/foods",
    name: "Foods",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Foods" */ "../views/home/Foods.vue"),
  },
  {
    path: "/hotel",
    name: "Hotel",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Foods" */ "../views/home/Hotel.vue"),
  },
  {
    path: "/others",
    name: "Others",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Foods" */ "../views/home/Others.vue"),
  },
  {
    path: "/myCollects",
    name: "myCollects",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Foods" */ "../views/info/MyCollects.vue"),
  },
  {
    path: "/aboutMe",
    name: "AboutMe",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Foods" */ "../views/info/AboutMe.vue"),
  },
  {
    path: "/order",
    name: "Order",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Foods" */ "../views/info/Order.vue"),
  },
  {
    path: "/personInfo",
    name: "PersonInfo",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Foods" */ "../views/info/PersonInfo.vue"),
  },
  {
    path: "/login",
    name: "Login",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "Foods" */ "../views/login/Login.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
